<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html>
<head>
<script type="text/javascript" src="<%=path%>/scripts/My97DatePicker/WdatePicker.js"></script>
<base href="<%=basePath%>" target="_self">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>绩效考核系统</title>
<link href="styles/core.css" rel="stylesheet" type="text/css">
<link href="styles/Master.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="scripts/jquery/jquery.js"></script>
<script type="text/javascript" src="scripts/common.js"></script>
<script type="text/javascript" src="scripts/message.js"></script>

<script type="text/javascript" src="scripts/system/worker_select.js"></script>

<style>

</style>

<script>

function selectWorker()
{
	var o = {};
	o.workerCode = $('#workerCode').val();
	o.workerName = $('#workerName').val();
	window.returnValue = o;
	window.close();
}
</script>

</head>

<body>
<form name="workerForm" method="post" onsubmit="return false;">

	<s:hidden id="workerCode"></s:hidden>
	<s:hidden id="workerName"></s:hidden>
	<s:hidden name="pagerEntity.pageInfo.pageNow" id="pageNow"></s:hidden>
	<h2 style="text-align: left">工作人员列表</h2>
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td align="right" width="13%">
				姓名：
			</td>
			<td align="left" width="15%">
				<s:textfield name="workerSearchEntity.workerName" cssClass="input"></s:textfield>
			</td>
			<td align="right" width="13%">
				性别：
			</td>
			<td align="left" width="15%">
				<s:select list="#{'M':'男', 'F':'女'}" headerKey="" headerValue="" cssStyle="width: 135px;"
					name="workerSearchEntity.gender"></s:select>
			</td>
			<td align="right" width="14%">
				身份证号：
			</td>
			<td align="left" width="15%">
				<s:textfield name="workerSearchEntity.idCardNo" cssClass="input"></s:textfield>
			</td>
			<td align="right" width="15%" rowspan="2">
				<input type="image" src="<%=basePath%>images/search.jpg" onclick="search();"></input>
			</td>
		</tr>
		<tr>
			<td align="right" width="13%">
				出生日期：
			</td>
			<td align="left" width="15%">
				<s:textfield id="employedDate" name="workerSearchEntity.birthdayStart" cssClass="Wdate" onclick="WdatePicker({dateFmt: 'yyyy-MM-dd'})">
					<s:param name="value">
						<s:date name="workerSearchEntity.birthdayStart" format="yyyy-MM-dd"/>
					</s:param>
				</s:textfield>
			</td>
			<td align="center" width="13%">
				~
			</td>
			<td align="left" width="15%">
				<s:textfield id="employedDate" name="workerSearchEntity.birthdayEnd" cssClass="Wdate" onclick="WdatePicker({dateFmt: 'yyyy-MM-dd'})">
					<s:param name="value">
						<s:date name="workerSearchEntity.birthdayEnd" format="yyyy-MM-dd"/>
					</s:param>
				</s:textfield>
			</td>
			<td align="right" width="14%">
				岗位：
			</td>
			<td align="left" width="15%">
				<s:select id="jobId" list="jobList" listKey="columeId" listValue="name"
					name="workerSearchEntity.jobId" headerKey="" headerValue="" cssStyle="width: 135px;"></s:select>
			</td>
		</tr>
	</table>
	<hr width="100%" align="left" size="1" color="#E1EEF8">

	<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabHeader" id="dataInfo">
		<thead>
			<tr align="center" class="tdBg">
				<td style="text-align: center" nowrap="nowrap" width="10%">选择</td>
				<td style="text-align: center" nowrap="nowrap" width="10%">编号</td>
				<td style="text-align: center" nowrap="nowrap" width="10%">姓名</td>
				<td style="text-align: center" nowrap="nowrap" width="5%">性别</td>
				<td style="text-align: center" nowrap="nowrap" width="10%">出生日期</td>
				<td style="text-align: center" nowrap="nowrap" width="15%">身份证号</td>
				<td style="text-align: center" nowrap="nowrap" width="10%">民族</td>
				<td style="text-align: center" nowrap="nowrap" width="10%">学历</td>
				<td style="text-align: center" nowrap="nowrap" width="10%">岗位</td>
				<td style="text-align: center" nowrap="nowrap" width="10%">入职时间</td>
			</tr>
		</thead>
		<tbody>
			<s:if test="#request.pagerEntity.resultList.size==0">
		   		<tr>
		   			<td colspan="10" align="center">
		   				对不起！没有搜索到结果......
		   			</td>
		   		</tr>
		   	</s:if>
		   	<s:else>

				<s:set id="total" value="0"></s:set>
			    <s:set id="totalSum" value="0"></s:set>

				<s:iterator value="pagerEntity.resultList" id="worker" status="stat">
					<tr>
						<td style="text-align: center;">
							<input type="radio" name="radio_worker" onclick="$('#workerCode').val('<s:property value="#worker.workerCode"/>');$('#workerName').val('<s:property value="#worker.workerName"/>');"/>
						</td>
						<td>
							<s:property value="#worker.workerCode"/>
						</td>
						<td>
							<s:property value="#worker.workerName"/>
						</td>
						<td align="center">
							<s:if test="#worker.gender == \"M\"">男</s:if>
							<s:elseif test="#worker.gender == \"F\"">女</s:elseif>
						</td>
						<td>
							<s:date name="#worker.birthday" format="yyyy-MM-dd"/>
						</td>
						<td>
							<s:property value="#worker.idCardNo"/>
						</td>
						<td>
							<s:property value="#worker.nation"/>
						</td>
						<td>
							<s:property value="#worker.education"/>
						</td>
						<td>
							<s:property value="#worker.jobName"/>
						</td>
						<td>
							<s:date name="#worker.employedDate" format="yyyy-MM-dd"/>
						</td>
					</tr>
				</s:iterator>
				<tr class="tdBg">
					<td colspan="10" align="right">
						<s:include value="/pages/pagefooter.jsp"></s:include>
					</td>
				</tr>
			</s:else>
		</tbody>
	</table>

	<center>
		<div style="padding: 4px 0pt;">
			<input type="button" value="选择" class="btn_mouseout" onclick="selectWorker();"
				onmouseover="this.className='btn_mouseover'" onmouseout="this.className='btn_mouseout'"
				onmousedown="this.className='btn_mousedown'" onmouseup="this.className='btn_mouseup'">
			<input type="button" value="关闭" class="btn_mouseout" onclick="window.close();"
				onmouseover="this.className='btn_mouseover'" onmouseout="this.className='btn_mouseout'"
				onmousedown="this.className='btn_mousedown'" onmouseup="this.className='btn_mouseup'">
		</div>
	</center>
</form>

<div id="waiting" style="display: none;">
	<div id="background" class="background"></div>
	<div id="progressBar" class="progressBar">数据加载中，请稍等...</div>
</div>
</body>
</html>